package com.xy.wsl.api.sql.services;

import com.xy.wsl.api.sql.mapper.BaseMapper;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class BaseServiceImpl <T> implements BaseService<T>{

    @Autowired
    BaseMapper<T> mapper;

    @Override
    public int insert(T t) {
        return mapper.insert(t);
    }

    @Override
    public int batchInsert(List<T> list) {
        return mapper.batchInsert(list);
    }

    @Override
    public int deleteWithKey(Object key) {
        return mapper.deleteWithKey(key);
    }

    @Override
    public T getWithKey(Object key) {
        return mapper.getWithKey(key);
    }

    @Override
    public List<T> getListPage(String searchKey, int page, int pageSize) {
        return mapper.getListPage(searchKey,page,pageSize);
    }

    @Override
    public int getTotal(String searchKey) {
        return mapper.getTotal(searchKey);
    }
}
